package com.audaque.springboot.foshanupload.web.redisdemo.controller;




import com.audaque.springboot.foshanupload.redis.service.RedisLuaBucketRateLimterAnnoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

/**
 * @author wangyan01
 */


@RestController
@RequestMapping("redisLuaBucketRateLimter")
public class RedisLuaBucketRateLimterAnnoController {

    @Autowired
    RedisLuaBucketRateLimterAnnoService redisLuaBucketRateLimterAnnoService;


    @GetMapping("/add")
    public List<Boolean> add() throws Exception {
        List<Boolean> result = new ArrayList<>();
        for (int i = 0; i < 100; i++) {
            Boolean aBoolean = redisLuaBucketRateLimterAnnoService.addResult();
            result.add(aBoolean);
        }
        return result;
    }
}
